
**TABLE 5 : Time allocation**

use "$data\followup_only", clear

********
*Generate various dummy & interaction variables
	gen A_EDT_elig= (A_EDT==1 & d_lleligible==1)
	gen A_EDT_no_elig= (A_EDT==1 & d_lleligible==0)
	gen nobt_ne_nolw = EDT_treat==0 & d_lleligible==0 & L_ttreat==0
	gen noelig_nolw= (B_LL==0 & d_lleligible==0)

	gen A_EDT_elig_fem=A_EDT_elig*female
	gen A_EDT_no_elig_fem=A_EDT_no_elig*female
	gen nobt_ne_nolw_fem=nobt_ne_nolw*female
	gen noelig_nolw_fem=noelig_nolw*female

********
*Panel A - Without female interactions
	local xvars "EDT_treat female d_lleligible bl_bus_owner fu_dummy*"
	local yvars "log_business_worktime_main log_paid_worktime log_work_agriculture log_cobustime_spouse log_spouse_paidwork log_spouse_farmwork " 
	est clear
	local j =1
	foreach y in `yvars' {
		tobit `y' `xvars' if (fu_dummy7==0 & post==1 ), ll ul cl(co_code1)
		estimates store `y'	
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & `y'>=0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}	
	estout * using "$out/Table5A.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2_p, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq")) replace

********
*Panel B - BT*female interactions
	local xvars "EDT_treat EDT_female female d_lleligible bl_bus_owner fu_dummy*"
	local yvars "log_business_worktime_main log_paid_worktime log_work_agriculture log_cobustime_spouse log_spouse_paidwork log_spouse_farmwork " 
	est clear
	local j =1
	foreach y in `yvars' {
		tobit `y' `xvars' if (fu_dummy7==0 & post==1 ), ll ul cl(co_code1)
		estimates store `y'		
		test EDT_treat + EDT_female=0
		estadd scalar p_diff1 = r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & `y'>=0 & female==0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table5B.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2_p p_diff1, fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1")) replace

********
*Panel C - Including various treatment groups
	local xvars "A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw female bl_bus_owner fu_dummy*"
	local yvars "log_business_worktime_main log_paid_worktime log_work_agriculture log_cobustime_spouse log_spouse_paidwork log_spouse_farmwork " 
	est clear
	local j =1
	foreach y in `yvars' {
		tobit `y' `xvars' if (fu_dummy7==0 & post==1 ), ll ul cl(co_code1)
		estimates store `y'
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & L_ttreat ==0 & `y'>=0 & d_lleligible==1)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table5C.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw) starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2_p p_diff1 p_diff2 p_diff3 p_diff4, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4")) replace
	estimates clear

********
*Panel D - Including treatment groups + Gender interactions
	local xvars "A_EDT_elig A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female bl_bus_owner fu_dummy*"
	local yvars "log_business_worktime_main log_paid_worktime log_work_agriculture log_cobustime_spouse log_spouse_paidwork log_spouse_farmwork " 
	est clear
	local j =1
	foreach y in `yvars' {
		tobit `y' `xvars' if (fu_dummy7==0 & post==1 ), ll ul cl(co_code1)
		estimates store `y'		
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		test A_EDT_elig + A_EDT_elig_fem=0
		estadd scalar p_diff5 = r(p)
		test A_EDT_no_elig + A_EDT_no_elig_fem=0
		estadd scalar p_diff6 = r(p)
		test B_LL +B_female =0
		estadd scalar p_diff7 = r(p)
		test C_EDT_LL +C_female =0
		estadd scalar p_diff8 = r(p)
		test nobt_ne_nolw + nobt_ne_nolw_fem=0
		estadd scalar p_diff9= r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & L_ttreat ==0 & `y'>=0 & d_lleligible==1 & female==0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table5D.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig A_EDT_no_elig A_EDT_elig_fem A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2_p p_diff1 p_diff2 p_diff3 p_diff4 p_diff5 p_diff6 p_diff7 p_diff8 p_diff9, fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4" "p5" "p6" "p7" "p8" "p9")) replace

**Mean of positive among controls 
	sum log_business_worktime_main if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_business_worktime_main >=0
	sum log_paid_worktime if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_paid_worktime >=0
	sum log_work_agriculture if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_work_agriculture >=0
	
	sum log_cobustime_spouse if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_cobustime_spouse > -4
	sum log_spouse_paidwork if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_spouse_paidwork > -4
	sum log_spouse_farmwork if fu_dummy7==0 & EDT_treat==0 & L_ttreat==0 &  log_spouse_farmwork > -4

***Positive log hours percentages
	tab log_business_worktime_main
	di 1909/3494
		*= .5463652

	tab log_paid_worktime
	di 2705 /3494
		* = .77418432

	tab log_work_agriculture
	di 1957/3494
		* = .56010303
	
	tab log_cobustime_spouse
	di 1028/3494
		* = .29421866
	
	tab log_spouse_paidwork
	di 2738/3494
		*= .78362908
	
	tab log_spouse_farmwork
	di 2229/3494
		* = .63795077
	
	su log_business_worktime_main log_paid_worktime
	su log_business_worktime_main if log_business_worktime_main > -4
	su log_paid_worktime if log_paid_worktime > -4
